package io;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fis = new FileOutputStream("./flush.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fis);

        bos.write(65);
        bos.write(66);
        bos.write(67);
        //强行将缓冲区内容写到文件中
        //close() 方法包含flush 功能，关闭文件的重要性
        bos.flush();
    }
}
